<?php
require('DataMapper.php');
require('menuItemTDG_model.php');
require('MenuItem.php');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of MenuItemMapper
 *
 * @author davidsciacchettano
 */
    class MenuItemMapper extends DataMapper{
        public static function findById($mi) {
            $m = new MenuItem();
            
            $m = MenuItemTDG_model::findById($mi->getId());
            
            return $m;
        }
        
        public static function findAll() {
            $mList = MenuItemTDG_model::findAll();
            
            return $mList;
        }
        
        public static function insert($mi) {
            MenuItemTDG_model::insert($mi->getName(), $mi->getComment(), $mi-getFourSquarePicRef());
        }
        
        public static function update($mi) {
            MenuItemTDG_model::update($mi->getId(), $mi->getVersion(), $mi->getName(), 
                    $mi->getComment(), $mi->getFourSquarePicRef());
        }
        
        public static function delete($mi) {
            MenuItemTDG_model::delete($mi->getId(), $mi->getVersion());
        }
    }

?>
